import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86187
 * Date: 2022-07-22
 * Time: 12:39
 */

public class Test {
    public static void mainDay1(String[] args) {
        String str = "hello world!";
        //System.out.println(str.substring(0, 3));
        System.out.println(str.length());
    }

    public static void mainDay2(String[] args) {
        double x = 1.2;
        //long l = 1.2; error

    }

    public static void mainDay22(String[] args) {
        int x = 0;
        int y = 0;
        int k = 0;
        for (int z = 0; z < 5; z++) {

            if ((++x > 2) && (++y > 2) && (k++ > 2)) {
                x++; ++y; k++;
            }
        }
        System.out.println(x + "" +y + "" +k);
    }

    public static void main1(String[] args) {
        int[] arr = {0,0,1,1,1,2,2,3,3,4};
        removeDuplicates(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static int removeDuplicates(int[] nums) {

        if(nums.length <= 1) {
            return nums.length;
        }
        int ans = nums.length;
        for(int left = 0; left < ans - 1; left++) {
            if(nums[left] == nums[left+1]) {
                boolean flg = false;

                for(int i = left; i < ans - 1; i++) {
                    nums[i] = nums[i+1];
                    flg = true;
                }
                if(flg) {
                    ans--;
                }
            }
        }
        return ans;
    }

    public static void main2(String[] args) {
        //System.out.println(14^3);
        byte a = 127;
        byte b = 127;
        a+=b;
        System.out.println(b);

        System.out.println(-5 + 1/4 + 2*-3 + 5.0);

    }

    public static void main(String[] args) {
        int x=3; int y=1;
        if(x=y)
            System.out.println("Not equal");
        else
            System.out.println("Equal");
    }
}
